<?php
$aux = explode("_", $_SESSION['pag']);
$voltar = $aux[0];

if ($_GET['aux']){ $_SESSION['aux'] = "_{$_GET['aux']}"; } else { unset($_SESSION['aux']); }
?>
<input name="voltar" type='button' class="btn" value="<?= $t_voltar ?>" onClick="javascript:location.href='?pag=<?=$voltar.$_SESSION['aux'];?>';" />